import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import styleImport from 'vite-plugin-style-import';
const { resolve } = require('path')


// https://vitejs.dev/config/
const envResolve = (mode, env) => loadEnv(mode, process.cwd())[env];

export default defineConfig(({ command, mode }) => {
  return {
    base: envResolve(mode, "VITE_BASE"),
    plugins: [
      vue(),
      styleImport({
        libs: [
        ],
      })],
    resolve: {
      alias: [{ find: '@', replacement: resolve(__dirname, 'src') }],
    },
    server: {
      port: 8000
    }
  }
})